package com.gjy.design.composite.f;

import java.util.ArrayList;
import java.util.List;

/**
 * @author gjy
 * @version 1.0
 * @since 2025-11-11 10:57:59
 */
public class File extends FileSystemComponent {

    public File(String name) {
        super(name);
    }

    @Override
    public void display() {
        System.out.println("文件: " + name);
    }

    @Override
    public void add(FileSystemComponent component) {
        throw new UnsupportedOperationException("文件不能添加子组件");
    }

    @Override
    public void remove(FileSystemComponent component) {
        throw new UnsupportedOperationException("文件不能删除子组件");
    }

    @Override
    public List<FileSystemComponent> getChildren() {
        return new ArrayList<>();
    }

}